<div id="addOwnerModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b ">添加{{addOwnerInfo.componentTitle}}</h3>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">姓名</label>
                                <div class="col-sm-10"><input v-model="addOwnerInfo.name" type="text"
                                        placeholder="必填，请填写姓名" class="form-control"></div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">性别</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="addOwnerInfo.sex">
                                        <option selected disabled value="">必填，请选择性别</option>
                                        <option value="0">男</option>
                                        <option value="1">女</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">年龄</label>
                                <div class="col-sm-10"><input v-model="addOwnerInfo.age" type="number"
                                        placeholder="可选，请填写年龄" class="form-control"></div>
                            </div>
                            <div class="form-group row" v-if="addOwnerInfo.componentTitle == '成员'">
                                <label class="col-sm-2 col-form-label">类型</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="addOwnerInfo.ownerTypeCd">
                                        <option selected disabled value="">必填，请选择类型</option>
                                        <option value="1002">家庭成员</option>
                                        <option value="1003">租客</option>
                                        <option value="1005">其他</option>
                                    </select></div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">身份证</label>
                                <div class="col-sm-10"><input v-model="addOwnerInfo.idCard" type="text"
                                        placeholder="可选，请填写身份证" class="form-control"></div>
                            </div>
                        </div>
                        <div class="col-sm-6" style="text-align:center">
                            <div class="form-group row">
                                <div style="width: 100%;" v-show="addOwnerInfo.ownerPhoto != ''">
                                    <img width="80%" height="150rem" v-bind:src="addOwnerInfo.ownerPhoto" alt="业主照片">
                                </div>
                                <div style="width: 100%;" v-show="addOwnerInfo.ownerPhoto == ''">
                                    <div v-show="addOwnerInfo.videoPlaying == true">
                                        <video id="ownerPhoto" style="width: 100%;height: 10rem;"></video>
                                        <canvas id="canvas" style="display:none;"></canvas>
                                    </div>
                                    <div v-show="addOwnerInfo.videoPlaying == false">
                                        <img width="80%" height="150rem" src="/img/noPhoto.jpg" alt="业主照片">
                                    </div>
                                </div>
                                <div style="margin: 10px auto 0px auto;" class="text-center">

                                    <button class="btn btn-primary" type="button"
                                        v-if="addOwnerInfo.videoPlaying == true && addOwnerInfo.ownerPhoto != ''"
                                        v-on:click="_reOpenVedio()"><span
                                            class="glyphicon glyphicon-camera"></span>摄像头</button>
                                    <button class="btn btn-primary" type="button"
                                        v-if="addOwnerInfo.videoPlaying == true && addOwnerInfo.ownerPhoto == ''"
                                        v-on:click="_takePhoto()"><span class="glyphicon glyphicon-camera"></span>
                                        拍照</button>
                                    <span class="btn btn-default btn-file" v-on:click="_uploadPhoto($event)">
                                        <span class="fileinput-new">上传照片</span>
                                    </span>
                                    <input type="file" class="file" accept=".jpg" id="uploadOwnerPhoto" hidden
                                        v-on:change="_choosePhoto($event)">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row" style="margin-top: -15px;">
                        <div class="col-sm-6">
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">手机</label>
                                <div class="col-sm-10"><input v-model="addOwnerInfo.link" type="number"
                                        placeholder="必填，请填写联系方式" class="form-control"></div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">备注</label>
                                <div class="col-sm-10"><input v-model="addOwnerInfo.remark" type="tel"
                                        placeholder="可填，请填写备注" class="form-control"></div>
                            </div>
                        </div>
                    </div>

                    <div v-for="(item,index) in addOwnerInfo.attrs">

                        <div class="row" v-if="index % 2 == 0">
                            <div class="col-sm-6">
                                <div class="form-group row" v-if="item.specType == '2233'">
                                    <label class="col-sm-2 col-form-label">{{item.specName}}</label>
                                    <div class="col-sm-10">
                                        <input v-model="item.value" type="text" :placeholder="item.specHoldplace"
                                            class="form-control">
                                    </div>
                                </div>

                                <div class="form-group row" v-if="item.specType == '3344'">
                                    <label class="col-sm-2 col-form-label">{{item.specName}}</label>
                                    <div class="col-sm-10">
                                        <select class="custom-select" v-model="item.value">
                                            <option selected disabled value="">{{item.specHoldplace}}</option>
                                            <option v-for="value in item.values" :label="value.valueName"
                                                :value="value.value">
                                                {{item.valueName}}
                                            </option>

                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6" v-if="index < addOwnerInfo.attrs.length-1">
                                <div class="form-group row" v-if="addOwnerInfo.attrs[index+1].specType == '2233'">
                                    <label
                                        class="col-sm-2 col-form-label">{{addOwnerInfo.attrs[index+1].specName}}</label>
                                    <div class="col-sm-10">
                                        <input v-model="addOwnerInfo.attrs[index+1].value" type="text"
                                            :placeholder="addOwnerInfo.attrs[index+1].specHoldplace"
                                            class="form-control">
                                    </div>
                                </div>
                                <div class="form-group row" v-if="addOwnerInfo.attrs[index+1].specType == '3344'">
                                    <label
                                        class="col-sm-2 col-form-label">{{addOwnerInfo.attrs[index+1].specName}}</label>
                                    <div class="col-sm-10">
                                        <select class="custom-select" v-model="addOwnerInfo.attrs[index+1].value">
                                            <option selected disabled value="">
                                                {{addOwnerInfo.attrs[index+1].specHoldplace}}</option>
                                            <option v-for="value in addOwnerInfo.attrs[index+1].values"
                                                :label="value.valueName" :value="value.value">
                                                {{addOwnerInfo.attrs[index+1].valueName}}
                                            </option>

                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <button class="btn btn-primary float-right" type="button" v-on:click="saveOwnerInfo()">
                            <i class="fa fa-check"></i>&nbsp;保存
                        </button>
                        <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
                            data-dismiss="modal">取消
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>